#ifndef PWM_H
#define PWM_H

#include <stdint.h>

#define MAX_DUTY_VALUE 10000u

// PWM通道映射
// 比如PWM1映射到timer1 timer_ch_0
// PWM2映射到timer2 timer_ch_2
typedef struct pwm_ch_mapping_tag 
{
  uint32_t timer_periph;//定时器
  uint8_t timer_ch;     //定时器通道
} pwm_ch_mapping_t;
extern void PWM_Init(uint32_t freq_timer0,uint32_t freq_timer1,uint32_t freq_timer2,uint32_t freq_timer3);

extern void PWM_Set_Duty(uint8_t ch, uint16_t duty);

void PWM_ChangeFreq(uint32_t freq_timer0,uint32_t freq_timer1,uint32_t freq_timer2,uint32_t freq_timer3);

#endif

